package com.pshcp.common.enums;

/**
 * @Description: 医生职称 0-医师，1-住院医师，2-主治医师，3-副主任医生，4-主任医师
 * @Author: xiaoche
 * @Date: 2022/10/29 12:36
 */
public enum DoctorLevelEnum {

    HEALERS(0, "医师"),

    RESIDENT(1, "住院医师"),

    ATTENDING(2, "主治医师"),

    DEPUTY_CHIEF_PHYSICIAN(3, "副主任医生"),

    CHIEF_PHYSICIAN(4, "主任医师"),
    ;

    private Integer code;
    private String desc;

    DoctorLevelEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDescByCode(int code){
        for(DoctorLevelEnum e : DoctorLevelEnum.values()){
            if(e.getCode().intValue() == code){
                return e.getDesc();
            }
        }
        return null;
    }

}
